﻿using System.ServiceProcess;
using System.Diagnostics;

namespace WarmUpService
{
	public partial class WarmUpService : ServiceBase
	{
		 string sourceName = "WarmUpServiceSource";
		 string logName = "WarmUpServiceLog";

		public WarmUpService()
		{
			InitializeComponent();
			if (!EventLog.SourceExists(sourceName))
			{
				EventLog.CreateEventSource(sourceName, logName);
			}
			logService.Source = sourceName;
			logService.Log = logName;

		}

		protected override void OnStart(string[] args)
		{			
			logService.WriteEntry("Warm Up Service Started");
			TargetOperate operate = new TargetOperate();
			operate.GetConfigDetails();			
		}

		protected override void OnStop()
		{
			logService.WriteEntry("Warm Up Service Stopped");
		}
	}
}
